import pytest
import warnings
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_a():
    print("---test_a")
    assert fun()==1


def fun():
    print("---fun")
    warnings.warn(UserWarning("自定义warning"))
    return 1